package com.example.voicebox.vm;

import androidx.databinding.BaseObservable;

import com.example.voicebox.model.VoiceBox;
import com.example.voicebox.tools.VoicePlayer;

/**
 * 代表item_voice_box.xml文件的viewmodel对象
 * */
public class VoiceBoxVM{
    private VoicePlayer mVoicePlayer;

    private VoiceBox mVoiceBox;

    public VoiceBoxVM(VoicePlayer voicePlayer){
        mVoicePlayer = voicePlayer;
    }

    public void onClickByVoice(){
        mVoicePlayer.playVoice(mVoiceBox);
    }

    public VoiceBox getVoiceBox() {
        return mVoiceBox;
    }

    public void setVoiceBox(VoiceBox mVoiceBox) {
        this.mVoiceBox = mVoiceBox;
    }
}
